#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
typedef long long LL;
const int N = 3e5 + 10;
int cnt1;
map<LL, int>mp, mp3;
map<LL, int>mp2;
struct node
{
	int a, b;
}S[N];
LL a[N];
int n, k;
LL s[N];
int cmp(node a, node b)
{
	return a.a < b.a;
}
int find(int x)
{
	if (!mp[x]) {
		mp[x] = ++cnt1;
	}
	mp2[cnt1] = x;
	return mp[x];
}
int main()
{
	cin >> n >> k;
	LL sum1 = 0;
	for (int i = 1; i <= n; i++) {
		int x, y;
		cin >> x >> y;
		sum1 += y;
		S[i] = { x,y };
	}
	sort(S + 1, S + n + 1, cmp);
	for (int i = 1; i <= n; i++) {
		//cout << S[i].a << endl;
	}
	LL sum = 0;
	for (int i = 1; i <= n; i++) {
		int x = find(S[i].a);
		//cout << "x==" << x << endl;
		s[x] += S[i].b;
		//cout << "s[x]==" << s[x] << endl;
	}
	/*cout << "sum1==" << sum1 << endl;
	cout << "s0==" << s[0] << endl;*/
	for (int i = 1; i <= n; i++) {
		int x = find(S[i].a);
		if (!mp3[x]) {
			mp3[x] = 1;
			//cout << "x==" << x << endl;
			s[x] += s[x - 1];
			a[x] = sum1 - s[x - 1];
			//cout << "a[x]==" << a[x] << endl;
		}
	}
	int l = 0, r = cnt1 + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (a[mid] > k)l = mid;
		else r = mid;
	}
	//cout << "r==" << r << endl;
	//cout << mp[r] << endl;
	cout << mp2[r - 1] + 1 << endl;
	return 0;
}